package tiantao.taogu.TgEnum;

/**
 *
 */
public enum MedicalCardRelationEnum {

  SELF("本人", 0),
  PARENT("父母", 1),
  SPOUSE("配偶", 2),
  CHILD("子女", 3),
  OTHER("其他", 4);

  private String name;

  private int id;

  private MedicalCardRelationEnum(String name, int id) {
    this.name = name;
    this.id = id;
  }

  public static String getName(int id) {
    for (MedicalCardRelationEnum o : MedicalCardRelationEnum.values()) {
      if (o.getId() == id) {
        return o.name;
      }
    }
    return null;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }
}
